<template>
    <div>
        <van-checkbox-group v-model="result" ref="eee">
            <van-cell-group>
                <van-cell
                        v-for="(item, index) in list"
                        clickable
                        :key="item"
                        :title="`复选框 ${item}`"
                        @click="toggle(index)"
                >
                    <van-checkbox slot="right-icon" :name="item" ref="checkboxes" />
                </van-cell>
            </van-cell-group>
        </van-checkbox-group>
        <van-button slot="right-icon" v-model="eew" name="item"  @click="handleClick" />

    </div>
</template>

<script>
export default {
    name: "test",
    data() {
        return {
            list: ['a', 'b'],
            result: [],
            eew:false
        };
    },
    methods: {
        toggle(index) {
            this.$refs.checkboxes[index].toggle();
        },
        handleClick(){
            console.log(3)
            console.log(this.$refs.checkboxes)
            // this.$refs.checkboxes[0].toggle();
        }
    }
}
</script>

<style scoped>

</style>
